package cn.xz.gobang.service

import android.content.Context

object ServerUtils {

    var mServer: ServerManager? = null

    fun ins(context: Context){
        if (mServer != null){
            mServer!!.stopServer()
        }
        mServer = null
        mServer = ServerManager(context)
    }

    fun startServer(){
        if (mServer != null){
            mServer!!.startServer()
        }
    }


    fun stopServer(){
        if (mServer != null){
            mServer!!.stopServer()
        }
    }

}